<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/commons/taglibs.jsp"%>
<!DOCTYPE html >
<html>
<head>
<jsp:include page="/jsp/commons/cssinclude.jsp"></jsp:include>
<jsp:include page="/jsp/commons/scriptinclude.jsp"></jsp:include>
<meta charset="utf-8">
<title>晶品科技信息管理系统-总经理</title>
<meta name="keywords" content="">
<meta name="description" content="">

<script type="text/javascript">
	//分页查询
	function queryCategory() {
		var path = "${ctx}/dispatch/dispatchAction!list.action";
		query(path);
	}
	
	function queryPage(path, pageindex) {
		pageIndex = pageindex;
		query(path);

	}
	$(document).ready(function() {
		queryCategory();

	});
</script>
</head>
<body>
	 
	<div class="mainbox">
		<div class="main_content"> 
			<div class="main_right">
				<div class="main_rightbox">
					<!--面包屑 begin-->
					<div class="ec_crumb_kc">
						<span><a class="icon_index" href="${ctx}/jsp/commons/right.jsp">返回首页</a></span>当前位置：<a
							style="cursor: pointer; color: #0678BD;" href="${ctx }">首页</a>&nbsp;&gt;&nbsp;
					    <c:choose>
					    <c:when test="${pageType eq '1'}">
					    <a style="cursor: pointer; color: #0678BD;" href="${ctx }">项目中心</a>&nbsp;&gt;&nbsp;
						<em> 售后部 </em>
					    </c:when>
					    <c:otherwise>
					    <em> 调度中心 </em>
					    </c:otherwise>
					    </c:choose>
					</div>
					<!--配置图片 begin-->
					 
					 <div class="service">
					 <c:if test="${pageType eq '1'}">
					    <a class="lmImg icon1" href="${ctx}/dispatch/dispatchAction!addInit.action">报修</a>
					 </c:if>
					</div>
					<!--查询 begin-->
					<div class="user">
						<div class="user_search">
							<form id="businessForm" method="post">
								<div class="frm_cont" id="lmname">
									<label for="lmname">报修单位：</label> <input type="text"
										value="请输入报修单位" id="lmname" 
										 name="dispatch.customerName" />
								</div>
								<div class="frm_cont" id="flm">
									<label for="flm">报修路线：</label> <input type="text"
										value="请输入报修路线" id="flm" 
										 name="dispatch.pathId" />
								</div>
								<div class="frm_cont" id="spfl">
									<label for="spfl">报修日期：</label> 
								   <input type="text" id="birthday" class="Wdate" 
										name="dispatch.repairDate" style="cursor:pointer" onClick="WdatePicker()"  value="" />
								</div>
								<div class="frm_cont" id="lrfs">
									<label for="lrfs">维修员：</label> <select id="status"
										name="dispatch.maintenanceManId"
										style="border: 1px solid #DDDDDD; color: #999999; float: right; height: 29px; line-height: 29px; padding-left: 5px; width: 218px;">
										<option value="">---请选择---</option>
										<c:forEach items="${lstUsers }" var="user" >
										<option value="${user.userCode}">${user.name }</option>
										</c:forEach>
									</select>
								</div>

							</form>
						</div>
						<div class="tbn_search" id="btncenter">
							<a href="javascript:void(0)"
								onclick="queryPage('${ctx}/dispatch/dispatchAction!list.action',0)">查询</a>
						</div>
						<div class="clear"></div>
					</div>
					<!--表格 & 分页-->
					<div id="Searchresult">
						<table width="100%" border="0" cellspacing="0" cellpadding="0"
							class="tab">
							<tr>
								<th>序号</th>
								<th>报修日期</th>
								<th>客户名称</th>
								<th>报修联系人</th>
								<th>报修联系电话</th>
								<th>故障原因</th>
								<th>路线</th>
								<th>维修技术员</th>
								<th>维修技术员联系方式</th>
								<th>操作</th>
							</tr>
							<tr>
								<td colspan="8">正在查询...</td>
							</tr>
						</table>
					</div>

				</div>
			</div>
		</div>
	</div>


	<!-- JQ -->
	<script type="text/javascript">
		function updateStatus(dispatchId, flag) {
			//提示语
			var tip = "";
			if (flag == "Y") {
				tip = "启用"; 
			} else {
				tip = "禁用";
			}

			//异步请求修改状态
			if (confirm("确定要" + tip + "该条记录？")) {
				$
						.post(
								"${ctx}/dispatch/dispatchAction!updateState.action",
								{
									random : Math.random(),
									"dispatch.id" : dispatchId,
									"dispatch.state" : flag
								},
								function(data) {
									var jsonData = strToJson(data);
									if (jsonData.flag == "error") {
										alert(jsonData.errorMsg);
									}
									window.location.href = "${ctx}/dispatch/dispatchAction!initdispatch.action";
								});
			}
		}
	</script>
</body>
</html>